// Copyright 2011 Jay Young. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @fileoverview
 *
 * Event types for post-related events.
 */

goog.provide('rb.post.EventType');
goog.provide('rb.post.PostEvent');

goog.require('goog.events');
goog.require('goog.events.Event');


/**
 * Event types for post-related events.
 * @enum {string}
 */
rb.post.EventType = {
  /**
   * Dispatched when a particular post is displayed to the user.
   */
  DISPLAY: goog.events.getUniqueId('display'),

  /**
   * Dispatched when a new post is created.
   */
  CREATED: goog.events.getUniqueId('created')
};



/**
 * An event class to be dispatched when post-related events occur.
 *
 * @param {rb.post.EventType} type The type of event.
 * @param {rb.post.BlogPost} post The post object related to this event.
 *
 * @constructor
 * @extends {goog.events.Event}
 */
rb.post.PostEvent = function(type, post) {
  goog.base(this, type);

  /**
   * @type {rb.post.BlogPost}
   */
  this.post = post;
};
goog.inherits(rb.post.PostEvent, goog.events.Event);
